//
//  GCW_SingerListTableViewCell.m
//  MooMusic
//
//  Created by 管晨雯 on 15/10/26.
//  Copyright © 2015年 wjy. All rights reserved.
//

#import "GCW_SingerListTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation GCW_SingerListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        self.headImage = [[UIImageView alloc]init];
        [self.contentView addSubview:self.headImage];
        
        self.labelSingerName = [[UILabel alloc]init];
        [self.contentView addSubview:self.labelSingerName];
        
        self.ringhtImage = [[UIImageView alloc]init];
        [self.contentView addSubview:self.ringhtImage];
    }
    
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.headImage.frame = CGRectMake(15 * WIDTH, 12 * HEIGH, 80 * WIDTH , 80 * HEIGH);
    //    self.headImage.backgroundColor = [UIColor yellowColor];
    self.headImage.layer.cornerRadius = 40;
    self.headImage.layer.masksToBounds = YES;
    
    self.labelSingerName.frame = CGRectMake(120 * WIDTH, 30 * HEIGH, 120 * WIDTH, 40 * HEIGH);
    self.labelSingerName.textAlignment = 1;
    //    self.labelSingerName.backgroundColor = [UIColor brownColor];
    
    
    self.ringhtImage.frame = CGRectMake(340 * WIDTH, 20 * HEIGH, 40 * WIDTH, 40 * HEIGH);
    //    self.ringhtImage.backgroundColor = [UIColor orangeColor];
    self.ringhtImage.image = [UIImage imageNamed:@"jiantou-2@2x.png"];
    
    
}

- (void)setListModel:(GCW_SingerListModel *)listModel
{
    _listModel = listModel;
    
    if (self.listModel.pic_url != nil) {
        
        [self.headImage sd_setImageWithURL:[NSURL URLWithString:self.listModel.pic_url] placeholderImage:nil];
        
    }
    
    if (self.listModel.singer_name != nil) {
        
        self.labelSingerName.text = self.listModel.singer_name;
    }

}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
